package com.mt.api.constants.enums;

import com.mt.api.util.EnumMappingUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Map;

/**
 * @Author: plover
 * @Date: 2021/01/25/10:27
 * @Description: 账号类型 0-未分配 1-老板 2-配货员 3-销售员
 */
@Getter
@AllArgsConstructor
public enum MenuTypeEnum {
    CATEGORY(1, "分类"),
    FUNCTION(2, "功能"),
    BUTTON(3, "按钮"),
    ;


    private Integer code;
    private String name;

    private static final Map<Integer, MenuTypeEnum> statusEnumMap =
            EnumMappingUtil.toMappingMap(MenuTypeEnum.class, MenuTypeEnum::getCode);

    public static MenuTypeEnum ofCode(Integer code) {
        return statusEnumMap.get(code);
    }

}
